#!/usr/bin/make -f

export QT_SELECT=5

QMAKE_OPTS = DEFINES+=NO_DEBUG_ON_CONSOLE
MAKE_OPTS  = PREFIX=/usr QMAKE=qmake LRELEASE=lrelease QMAKE_OPTS="$(QMAKE_OPTS)"

override_dh_auto_configure:
	QT_SELECT=qt5 dh_auto_configure \
                -- "QMAKE_CXXFLAGS=$(CFLAGS)" \
                kylin-video.pro

%:
	dh $@

override_dh_install:
	./autogen.sh
	dh_install

override_dh_missing:
	dh_missing --fail-missing

override_dh_auto_clean:
	[ ! -d src/.moc ] || $(RM) -r src/.moc
	[ ! -d src/.obj ] || $(RM) -r src/.obj
	[ ! -d src/.ui ] || $(RM) -r src/.ui
	[ ! -f src/Makefile ] || dh_auto_clean

override_dh_auto_build:
	dh_auto_build -- $(MAKE_OPTS)

#override_dh_auto_build:
#	dh_auto_build -- $(MAKE_OPTS) DOC_PATH=\\\"/usr/share/doc/kylin-video\\\"

#override_dh_auto_install:
#	dh_auto_install -- $(MAKE_OPTS) DOC_PATH=/usr/share/doc/kylin-video
#	rm -f debian/tmp/usr/share/doc/kylin-video/Copying.txt
